package com.linfeng.business.admin.web;

import com.linfeng.business.admin.api.IAdminService;
import com.linfeng.business.admin.dto.event.admin.cmd.AdminLoginCmd;
import com.linfeng.component.common.response.ResponseEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/login")
public class LoginController {

    @Autowired
    IAdminService iAdminService;

    @PutMapping(value = "/v1/login")
    public ResponseEntity login(@RequestBody AdminLoginCmd adminLoginCmd) {

        return ResponseEntity.body(iAdminService.login(adminLoginCmd));
    }
}
